//
//  OAPwsChangeVC.m
//  OA项目
//
//  Created by innofive on 2018/4/12.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "OAPwsChangeVC.h"
#import "UIBarButtonItem+Extension.h"
@interface OAPwsChangeVC ()

@end

@implementation OAPwsChangeVC

- (void)viewDidLoad {
    [super viewDidLoad];

    UIBarButtonItem *rightItem =[UIBarButtonItem OnCreateBarBtnItemName:@"完成" BarBtnstyle:(RightBarBtnItemStyle) Btntag:10 target:self action:@selector(onRightButton:)];
    //    UIButton *button = (id)[rightItem.customView viewWithTag:10];
    //    [button setNormalTitleColor:[UIColor blackColor]];
    //    [button setSelectTitle:@"完成"];
    //    button.titleLabel.font = kSysFont(kFitW(13));
    self.navigationItem.rightBarButtonItem = rightItem;
}


-(void)onRightButton:(UIButton *)button
{

    
}

-(void)onLoadViewByWillAppear:(UIView *)view
{
    UILabel *label1 = ({
        UILabel *l = [UILabel new];
        l.textColor = [UIColor blackColor];
        l.font = kSysFont(kFitW(13));
        l.text = @"请设置密码";
        [view addV:l];
        l;
    });
    
    UILabel *label2 = ({
        UILabel *l = [UILabel new];
        l.textColor = [UIColor blackColor];
        l.font = kSysFont(kFitW(12));
        l.text = @"登录密码用于登录app时使用";
        [view addV:l];
        l;
    });
    
    
    UILabel *label3 = ({
        UILabel *l = [UILabel new];
        l.textColor = [UIColor blackColor];
        l.font = kSysFont(kFitW(12));
        l.text = @"密码";
        [view addV:l];
        l;
    });
    
    
    UITextField *textF = ({
        UITextField *l = [[UITextField alloc]init];
        //l.backgroundColor = [UIColor redColor];
        l.hasBottomLine = YES;
        l.tag = 10;
        [view addV:l];
        l;
    });
    
    UILabel *label4 = ({
        UILabel *l = [UILabel new];
        l.textColor = hexCOLOR(@"D4A54E");
        l.font = kSysFont(kFitW(12));
        l.text = @"需6-20位字符";
        [view addV:l];
        l;
    });
    
    [self onMainQueueAddSub:^(UIView *view, CGPoint origin, CGSize size, CGPoint center) {
        [label1 sizeToFit];
        label1.top = kFitH(30);
        label1.left = kFitW(60);
        
        
        [label2 sizeToFit];
        label2.top = label1.bottom+kFitH(15);
        label2.left = kFitW(60);
        
        [label3 sizeToFit];
        label3.top = label2.bottom+kFitH(30);
        label3.left = kFitW(60);
        
        
        textF.size = CGSizeMake(size.width-2*kFitW(60), kFitH(30));
        textF.top = label3.bottom+kFitH(15);
        textF.left = kFitW(60);
        
        [label4 sizeToFit];
        label4.top = textF.bottom+kFitH(20);
        label4.left = kFitW(60);
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
